package com.venutech.gongan.common;

public enum EquipBindingWorkType {

    PositionInCorrect(0, "经纬度不匹配"),
    EquipNotFound(1, "设备未找到"),
    Others(2, "其他"),
    EquipToBeConfirm(3, "待确认设备");

    private int value;
    private String typeName;

    EquipBindingWorkType(int value, String typeName) {
        this.typeName = typeName;
        this.value = value;
    }

    public static String getNameByValue(int value) {
        for (EquipBindingWorkType item : EquipBindingWorkType.values()) {
            if (item.getValue() == value) {
                return item.getTypeName();
            }
        }
        return "";
    }

    public static EquipBindingWorkType getUserTypeByValue(int value) {
        EquipBindingWorkType equipBindingWorkType = EquipBindingWorkType.PositionInCorrect;
        if (value == EquipBindingWorkType.PositionInCorrect.getValue()) {
            equipBindingWorkType = EquipBindingWorkType.PositionInCorrect;
        } else if (value == EquipBindingWorkType.EquipNotFound.getValue()) {
            equipBindingWorkType = EquipBindingWorkType.EquipNotFound;
        } else if (value == EquipBindingWorkType.Others.getValue()) {
            equipBindingWorkType = EquipBindingWorkType.Others;
        } else if(value == EquipBindingWorkType.EquipToBeConfirm.getValue()) {
            equipBindingWorkType = EquipBindingWorkType.EquipToBeConfirm;
        }

        return equipBindingWorkType;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}
